<?php
use yii\helpers\Url;
?>
<div class="tpl-login">
    <div class="tpl-login-content">


        <form class="am-form tpl-form-line-form">
            <div class="am-form-group">
                <input type="text" class="tpl-form-input" id="company" placeholder="请输入客户代码">

            </div>
            <div class="am-form-group">

                <button type="button" id="login" class="am-btn am-btn-primary  am-btn-block tpl-btn-bg-color-success  tpl-login-btn">提交</button>

            </div>
        </form>
    </div>
</div>
<div class="am-modal am-modal-alert" tabindex="-1" id="my-alert">
    <div class="am-modal-dialog">
        <div class="am-modal-hd">警告</div>
        <div class="am-modal-bd">
           无效客户代码！
        </div>
        <div class="am-modal-footer">
            <span class="am-modal-btn">确定</span>
        </div>
    </div>
</div>
<?php if(!$isUser){?>
    <script>
        $(function () {
            $("#my-alert").modal("open");
        })
    </script>
<?php }?>
<script type="text/javascript">
    $("#login").click(function(){
        $("input").blur();
        var id=$("#company").val();
        window.location.href="<?=Url::to(['site/login'])?>?company="+id;
    })
    document.onkeydown = function(e){

        var ev = document.all ? window.event : e;

        if(ev.keyCode==13) {

            $("#login").click();

        }
    }

</script>